<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>显示</title>
    <script src="/html/js/axios.min.js"></script>
    <script src="/html/js/util.js"></script>
    <script>
        window.onload=function (){
            init(1);
        }
        async function init(pageNo){
            let info = await ajaxGet("/user/findAll",{pageNo});
            let str ="";
            for (let i = 0; i < info.list.length; i++) {
                let obj =info.list[i];
                str += `<tr><td>${obj.name}</td><td>${obj.sex}</td><td>${obj.money}</td><td>${obj.birthday}</td></tr>`;
            }
            $("data").innerHTML=str;

            let cutStr="";
            for (let i = 1; i < info.pages; i++) {
                cutStr+=`<a style="margin-left: 10px" href="javascript:init(${i})">${i}</a>`;
            }
            $("cutDiv").innerHTML=cutStr;
        }
    </script>
</head>
<body>
    <table border="1" cellspacing="0" width="60%">
        <thead><tr><td>用户名</td><td>性别</td><td>工资</td><td>生日</td></tr></thead>
        <tbody id="data"></tbody>
    </table>
    <div id="cutDiv"></div>
    <a href="/html/index.html">添加</a>
</body>
</html>